package com.hr.system.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * (SysUser)表实体类
 *
 * @author makejava
 * @since 2024-05-07 09:03:55
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_user")
@ApiModel(value="SysUser对象", description="")
@NoArgsConstructor
public class SysUser extends Model {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    //0是管理员用户 1 是普通用户
    private Integer type;
    //账号
    private String userName;
    //员工姓名
    private String empName;
    //员工性别
    private Integer gender;
    //密码
    private String password;
    //手机号
    private String phone;
    //0 生效 1不生效
    private Integer state;
    //邮箱
    private String email;
    //编号
    private String workCode;
    //部门id
    private Integer deptId;
    //入职时间
    private Date entryTime;
    //头像url
    private String pic;
    //备注
    private String remark;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    //创建时间
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    //更新时间
    private Date updateTime;

    public SysUser(String userName, String password, String type, String remark, String phone, Integer state, String email, String deptId, String workcode) {
        this.userName = userName;
        this.password = password;
        this.remark = remark;
        this.phone = phone;
        this.state = state;
        this.email = email;
        this.createTime = new Date();
    }
}
